<template>
	<view>
		<!-- 自定义头部导航栏 -->
		<navbar :title="title" :ctype="ctype" @conGoto="conGoto"></navbar>
		<view class="sannong">
			<view class="searchC">
				<!-- 搜索 -->
				<Search class="search_i" :inputConent="inputConent" :placeholder="placeholder" @goSearch="goSearch"></Search>
			</view>
			<view class="sannongMain">
				<view class="sannongselect">
					<view class="conSele" @click="selectCl">
						<text>请选择</text>
						<uni-icons type="down" size="10" color="#ccc" />
						<view class="c-sel" v-if="showSele">
							<view v-for="(item,index) in tabSele" :key="index" @click.stop="changeTab(index)" :class="{ 'tab-item-active': index == tabIndex }">{{item.text}}</view>
						</view>
					</view>
					<view class="fabu" @click="navUrl('/pages/home-btn/pages/publishingContent/publishingContent')">我要发布</view>
				</view>
				<view class="con-list" @click="navUrl('/pages/home-btn/pages/articleDetails/articleDetails')">
					<view class="clist_k">
						<view class="clist_tit">冬季食补宝典，这样吃养生又瘦身哦哦哦哦</view>
						<view class="l-txt">农业科普</view>
					</view>
					<view class="illustration">配图</view>
				</view>
			</view>
		</view>
		<view class="my-fabu" @click="navUrl('/pages/home-btn/pages/postedit/postedit')"><view class="btm">我发布的</view></view>
	</view>
</template>

<script>
	import Search from '../components/searchA'; //搜索
	import navbar from "@/components/navbarA" // 自定义头部导航栏组件
	export default {
		components: {
			Search,
			navbar
		},
		data() {
			return {
				/* 自定义导航栏 */
				title: "",
				ctype:'2',
				
				inputConent:'',
				placeholder:'请输入',
				tabIndex:0,
				tabSele:[{
					text:'农业科普'
				},{
					text:'农业新闻'
				},{
					text:'平台资讯'
				}],
				showSele:false
			}
		},
		onLoad(options) {
			if(options.title == 1){
				this.title = "三农贴吧"
			}else{
				this.title = '培训指导'
			}
		},
		methods: {
			goSearch(){
				
			},
			navUrl(url){
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.sannong{
	width: 100%;
	height: 100%;
}
.searchC{
	width: 95%;
	margin: 0 auto;
}
.sannongMain{
	width: 95%;
	margin: 0 auto;
	background-color: #fff;
	margin-top: 15rpx;
	border-radius: 10rpx;
	.sannongselect{
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1px solid #CCCCCC;
		height: 65rpx;
		font-size: 21rpx;
		
		.conSele{
			font-size: 21rpx;
			color: #A6A6A6;
			margin-left: 20rpx;
			position: relative;
			text{
				margin-right: 7rpx;
			}
		}
		.fabu{
			width: 105rpx;
			height: 35rpx;
			line-height: 35rpx;
			background-color: #FFA655;
			border-radius: 25px;
			text-align: center;
			color: #FFFEFE;
			margin-right: 20rpx;
		}
	}
	.con-list{
		width: 90%;
		margin: 0 auto;
		display: flex;
		align-items: center;
		margin-top: 15rpx;
		padding-bottom: 25rpx;
		border-bottom: 1px solid #CCCCCC;
		.clist_k{
			width: 70%;
			.clist_tit{
				font-weight: 400;
				font-size: 26rpx;
				color: #333232;
				// font-weight: bold;
				line-height: 40rpx;
			}
			.l-txt{
				font-size: 21rpx;
				color: #A6A6A6;
				margin-top: 20rpx;
			}
		}
	}
	.illustration{
		width: 28%;
		height: 114rpx;
		background: #D9D9D9;
		border-radius: 10rpx;
		margin-left: 2%;
	}
}
.con-list:last-child{
	border: none;
}
.c-sel{
	position: absolute;
	width: 119rpx;
	margin-left: 35rpx;
	background: #F2F2F2;
	border-radius: 5rpx;
	border: 1px solid #D9D9D9;
	text-align: center;
	z-index: 2;
	margin-top:8rpx;
	line-height: 45rpx;
	color: #A6A6A6;
}
.tab-item-active{
	color: #333333;
}
.my-fabu{
	position: fixed;
	bottom: 20rpx;
	width: 100%;
	.btm{
		width: 80%;
		margin: 0 auto;
		background-color: $main-color;
		text-align: center;
		height: 70rpx;
		line-height: 70rpx;
		font-weight: 400;
		font-size: 31rpx;
		color: #FFFFFF;
		border-radius: 25px;
	}
}
</style>
